package com.sinocare.project.common.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;

/**
 * 用户登录表(SncUserLogin)表实体类
 *
 * @author makejava
 * @since 2021-12-20 19:09:42
 */
@Data
@SuppressWarnings("serial")
@TableName(value = "snc_user_login")
public class SncUserLogin extends Model<SncUserLogin> {
    //主键，客户id
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    //手机号(唯一)
    private String phone;
    //密码(需要加密 MD5+盐+散列)
    private String password;

    //姓名
    private String name;
    //账号
    private String count;
    //令牌(?)
    private String token;
    //是非为管理员(0否1是，默认0)
    private Integer isAdmin;
    //创建时间(默认系统时间)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date createTime;
    //修改时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date updateTime;
    //职位id(?)
    private Integer posittionId;
    //状态(0禁用1正常，默认1)
    private Integer status;
    //尝试登录时间(?)
    private Integer tryLoginTimes;
    //锁定时间(?)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone="GMT+8")
    private Date pwdLockDay;
    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

